---
title:  Setting Properties
---

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

Geode provides a default distributed system configuration for out-of-the-box systems. To use non-default configurations and to fine-tune your member communication, you can use a mix of various options to customize your distributed system configuration.

<a id="setting_distributed_properties__section_67EBCC53EB174B108DA7271E2CD2B76C"></a>
Geode properties are used to join a distributed system and configure system member behavior. Configure your Geode properties through the `gemfire.properties` file, the Java API, or command-line input. Generally, you store all your properties in the `gemfire.properties` file, but you may need to provide properties through other means, for example, to pass in security properties for username and password that you have received from keyboard input.

**Note:**
Check with your Geode system administrator before changing properties through the API, including the `gemfire.properties` and `gfsecurity.properties` settings. The system administrator may need to set properties at the command line or in configuration files. Any change made through the API overrides those other settings.

**Note:**
The product `defaultConfigs` directory has a sample `gemfire.properties` file with all default settings.

Set distributed system properties by any combination of the following. The system looks for the settings in the order listed:

1.  `java.lang.System` property setting. Usually set at the command line. For applications, set these in your code or at the command line.

    Naming: Specify these properties in the format `gemfire.property-name`, where `property-name` matches the name in the `gemfire.properties` file. To set the gemfire property file name, use `gemfirePropertyFile` by itself
    -   In the API, set the `System` properties before the cache creation call. Example:

        ``` pre
        System.setProperty("DgemfirePropertyFile", "gfTest");
        System.setProperty("Dgemfire.mcast-port", "10999");

        Cache cache = new CacheFactory().create();
        ```
    -   At the `java` command line, pass in `System` properties using the `-D` switch. Example:

        ``` pre
        java -DgemfirePropertyFile=gfTest -Dgemfire.mcast-port=10999 test.Program
        ```
2.  Entry in a `Properties` object.

    Naming: Specify these properties using the names in the `gemfire.properties` file. To set the gemfire property file name, use `gemfirePropertyFile`.
    -   In the API, create a `Properties` object and pass it to the cache create method. Example:

        ``` pre
        Properties properties= new Properties();
        properties.setProperty("log-level", "warning");
        properties.setProperty("name", "testMember2");
        ClientCache userCache = 
            new ClientCacheFactory(properties).create();
        ```
    -   For the cache server, pass the properties files on the `gfsh` command line as command-line options. Example:

        ``` pre
        gfsh>start server --name=server_name --mcast-port=10338 --properties-file=serverConfig/gemfire.properties --security-properties-file=gfsecurity.properties
        ```

        See [Running Geode Server Processes](../../configuring/running/running_the_cacheserver.html) for more information on running cache servers.

3.  Entry in a `gemfire.properties` file. See [Deploying Configuration Files without the Cluster Configuration Service](../../configuring/running/deploying_config_files.html). Example:

    ``` pre
    cache-xml-file=cache.xml
    conserve-sockets=true
    disable-tcp=false
    ```

4.  Default value. The default property values are listed in the online Java documentation for `org.apache.geode.distributed.DistributedSystem`.


